#!/usr/bin/env python
# -*- coding:utf-8 -*-
# ######################### 生产者 #########################
#模糊匹配
import pika
import sys

connection = pika.BlockingConnection(pika.ConnectionParameters(
        host='192.168.136.8'))
channel = connection.channel()

channel.exchange_declare(exchange='topic_logs',
                         type='topic')

message = 'Hello World!'
channel.basic_publish(exchange='topic_logs',
                      routing_key="python",
                      body=message)
print(" [x] Sent %r" % (message))
connection.close()
